<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>ParseTree</title>
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ParseTree";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang"><span class="strong">Prev Class</span></a></li>
<li><a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?mmj/lang/ParseTree.html" target="_top">Frames</a></li>
<li><a href="ParseTree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">mmj.lang</div>
<h2 title="Class ParseTree" class="title">Class ParseTree</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>mmj.lang.ParseTree</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">ParseTree</span>
extends java.lang.Object</pre>
<div class="block">A simple tree structure to hold a ParseNode root.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a></strong></code>
<div class="block">Stores backreference information in "packed" and "compressed" formats.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../mmj/lang/ParseTree.html#ParseTree()">ParseTree</a></strong>()</code>
<div class="block">Constructor - default, creates empty ParseTree.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../mmj/lang/ParseTree.html#ParseTree(mmj.lang.ParseNode)">ParseTree</a></strong>(<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;root)</code>
<div class="block">Constructor - creates ParseTree using a ParseNode root.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../mmj/lang/ParseTree.html#ParseTree(mmj.lang.ParseTree.RPNStep[])">ParseTree</a></strong>(<a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a>[]&nbsp;rpn)</code>
<div class="block">Build a ParseTree from an RPN Stmt array.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#convertToRPN()">convertToRPN</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#convertToRPN(boolean)">convertToRPN</a></strong>(boolean&nbsp;pressLeaf)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#convertToRPNExpanded()">convertToRPNExpanded</a></strong>()</code>
<div class="block">Convert ParseTree to RPN Stmt array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#countParseNodes(boolean)">countParseNodes</a></strong>(boolean&nbsp;expanded)</code>
<div class="block">Count parse nodes in a ParseTree.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#deepClone()">deepClone</a></strong>()</code>
<div class="block">(Deep) Clone a ParseTree.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#deepCloneApplyingAssrtSubst(mmj.lang.Hyp[], mmj.lang.ParseNode[])">deepCloneApplyingAssrtSubst</a></strong>(<a href="../../mmj/lang/Hyp.html" title="class in mmj.lang">Hyp</a>[]&nbsp;assrtHypArray,
                           <a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>[]&nbsp;assrtSubst)</code>
<div class="block">(Deep) Clone a ParseTree while substituting a set of VarHyp substitutions
 specified by a parallel Hyp array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#deepCloneApplyingAssrtSubst(mmj.lang.Hyp[], mmj.lang.ParseNode[], java.util.List)">deepCloneApplyingAssrtSubst</a></strong>(<a href="../../mmj/lang/Hyp.html" title="class in mmj.lang">Hyp</a>[]&nbsp;assrtHypArray,
                           <a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>[]&nbsp;assrtSubst,
                           java.util.List&lt;<a href="../../mmj/lang/WorkVar.html" title="class in mmj.lang">WorkVar</a>&gt;&nbsp;workVarList)</code>
<div class="block">(Deep) Clone a ParseTree while substituting a set of VarHyp substitutions
 specified by a parallel Hyp array and keeping count of the number of
 dummy VarHyp substitutions.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#deepCloneApplyingWorkVarUpdates()">deepCloneApplyingWorkVarUpdates</a></strong>()</code>
<div class="block">(Deep) Clone a ParseTree while substituting a set of Work Var updates.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#deepCloneWNodeSub(mmj.lang.ParseNode, mmj.lang.ParseNode)">deepCloneWNodeSub</a></strong>(<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;matchNode,
                 <a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;substNode)</code>
<div class="block">(Deep) Clone a ParseTree while substituting a given node with another.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#findChildVarHypNode(int)">findChildVarHypNode</a></strong>(int&nbsp;childIndex)</code>
<div class="block">Finds first VarHyp within parseTree.root.child[i].</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#getLevelOneTwo()">getLevelOneTwo</a></strong>()</code>
<div class="block">Computes the levelOneTwo string (key) value after calculating it if the
 answer is not already known.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#getMaxDepth()">getMaxDepth</a></strong>()</code>
<div class="block">Gets the maximum depth of the tree after calculating it if the answer is
 not already known.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#getRoot()">getRoot</a></strong>()</code>
<div class="block">Return root of tree.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#isDup(int, mmj.lang.ParseTree[])">isDup</a></strong>(int&nbsp;parseCount,
     <a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>[]&nbsp;parseTreeArray)</code>
<div class="block">Check ParseTree array for duplicates.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#isDup(mmj.lang.ParseTree)">isDup</a></strong>(<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;parseTree)</code>
<div class="block">Check another ParseTree for duplication.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#resetLevelOneTwo()">resetLevelOneTwo</a></strong>()</code>
<div class="block">Resets the levelOneTwo string key value to the default value;</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#resetMaxDepth()">resetMaxDepth</a></strong>()</code>
<div class="block">Resets the maximum depth of the tree to the initial value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#setRoot(mmj.lang.ParseNode)">setRoot</a></strong>(<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;root)</code>
<div class="block">Set root of tree.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#squishTree()">squishTree</a></strong>()</code>
<div class="block">Compresses ("squishes") the tree to re-use repeated subtrees.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseTree.html#toString()">toString</a></strong>()</code>
<div class="block">Converts a ParseTree to a String consisting of Stmt labels in RPN order.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="ParseTree()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ParseTree</h4>
<pre>public&nbsp;ParseTree()</pre>
<div class="block">Constructor - default, creates empty ParseTree.</div>
</li>
</ul>
<a name="ParseTree(mmj.lang.ParseNode)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ParseTree</h4>
<pre>public&nbsp;ParseTree(<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;root)</pre>
<div class="block">Constructor - creates ParseTree using a ParseNode root.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>root</code> - the root node</dd></dl>
</li>
</ul>
<a name="ParseTree(mmj.lang.ParseTree.RPNStep[])">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ParseTree</h4>
<pre>public&nbsp;ParseTree(<a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a>[]&nbsp;rpn)</pre>
<div class="block">Build a ParseTree from an RPN Stmt array.
 <p>
 Note: A Metamath proof may contain a "?" to indicate a missing step.
 Missing steps are stored in mmj.lang.Theorem.proof[] as a "null" stmt
 reference. --> if rpn[i] == null, throw IllegalArgumentException</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>rpn</code> - Stmt array, may be parse or proof RPN.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if ParseTree cannot be built from the
             RPN (null statment or RPN incomplete.)</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="getRoot()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRoot</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;getRoot()</pre>
<div class="block">Return root of tree.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>ParseNode root of tree.</dd></dl>
</li>
</ul>
<a name="setRoot(mmj.lang.ParseNode)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRoot</h4>
<pre>public&nbsp;void&nbsp;setRoot(<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;root)</pre>
<div class="block">Set root of tree.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>root</code> - of tree.</dd></dl>
</li>
</ul>
<a name="isDup(int, mmj.lang.ParseTree[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDup</h4>
<pre>public&nbsp;boolean&nbsp;isDup(int&nbsp;parseCount,
            <a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>[]&nbsp;parseTreeArray)</pre>
<div class="block">Check ParseTree array for duplicates.
 <p>
 No longer used, except in BottomUpParser.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>parseCount</code> - number of trees in array.</dd><dd><code>parseTreeArray</code> - array of trees.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if duplicate found, else false.</dd></dl>
</li>
</ul>
<a name="isDup(mmj.lang.ParseTree)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDup</h4>
<pre>public&nbsp;boolean&nbsp;isDup(<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;parseTree)</pre>
<div class="block">Check another ParseTree for duplication.
 <p>
 No longer used, except in BottomUpParser.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>parseTree</code> - tree to compare.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if duplicate, else false.</dd></dl>
</li>
</ul>
<a name="deepClone()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deepClone</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;deepClone()</pre>
<div class="block">(Deep) Clone a ParseTree.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>true if duplicate, else false.</dd></dl>
</li>
</ul>
<a name="deepCloneWNodeSub(mmj.lang.ParseNode, mmj.lang.ParseNode)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deepCloneWNodeSub</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;deepCloneWNodeSub(<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;matchNode,
                          <a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;substNode)</pre>
<div class="block">(Deep) Clone a ParseTree while substituting a given node with another.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>matchNode</code> - node to replace.</dd><dd><code>substNode</code> - new node to substitute.</dd>
<dt><span class="strong">Returns:</span></dt><dd>new ParseTree.</dd></dl>
</li>
</ul>
<a name="deepCloneApplyingAssrtSubst(mmj.lang.Hyp[], mmj.lang.ParseNode[], java.util.List)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deepCloneApplyingAssrtSubst</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;deepCloneApplyingAssrtSubst(<a href="../../mmj/lang/Hyp.html" title="class in mmj.lang">Hyp</a>[]&nbsp;assrtHypArray,
                                    <a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>[]&nbsp;assrtSubst,
                                    java.util.List&lt;<a href="../../mmj/lang/WorkVar.html" title="class in mmj.lang">WorkVar</a>&gt;&nbsp;workVarList)</pre>
<div class="block">(Deep) Clone a ParseTree while substituting a set of VarHyp substitutions
 specified by a parallel Hyp array and keeping count of the number of
 dummy VarHyp substitutions.
 <p>
 This function is a helper for mmj.pa.ProofUnifier.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>assrtHypArray</code> - parallel array for assrtSubst</dd><dd><code>assrtSubst</code> - array of ParseNode sub-tree roots specifying hyp
            substitutions.</dd><dd><code>workVarList</code> - arrayList of WorkVar updated to contain set of Work
            Vars used in the subtree. substituted into the output.</dd>
<dt><span class="strong">Returns:</span></dt><dd>new ParseTree.</dd></dl>
</li>
</ul>
<a name="deepCloneApplyingAssrtSubst(mmj.lang.Hyp[], mmj.lang.ParseNode[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deepCloneApplyingAssrtSubst</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;deepCloneApplyingAssrtSubst(<a href="../../mmj/lang/Hyp.html" title="class in mmj.lang">Hyp</a>[]&nbsp;assrtHypArray,
                                    <a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>[]&nbsp;assrtSubst)</pre>
<div class="block">(Deep) Clone a ParseTree while substituting a set of VarHyp substitutions
 specified by a parallel Hyp array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>assrtHypArray</code> - parallel array for assrtSubst</dd><dd><code>assrtSubst</code> - array of ParseNode sub-tree roots specifying hyp
            substitutions.</dd>
<dt><span class="strong">Returns:</span></dt><dd>new ParseTree.</dd></dl>
</li>
</ul>
<a name="deepCloneApplyingWorkVarUpdates()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deepCloneApplyingWorkVarUpdates</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;deepCloneApplyingWorkVarUpdates()</pre>
<div class="block">(Deep) Clone a ParseTree while substituting a set of Work Var updates.
 <p>
 This function is a helper for mmj.pa.ProofUnifier.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>new ParseTree.</dd></dl>
</li>
</ul>
<a name="findChildVarHypNode(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>findChildVarHypNode</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;findChildVarHypNode(int&nbsp;childIndex)</pre>
<div class="block">Finds first VarHyp within parseTree.root.child[i].
 <p>
 This feat is useful for GrammarRule parse trees, which contain at most
 one VarHyp per root.child[i].</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>childIndex</code> - index into ParseNode.child array.</dd>
<dt><span class="strong">Returns:</span></dt><dd>first VarHyp ParseNode at/under child[i].</dd></dl>
</li>
</ul>
<a name="convertToRPNExpanded()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>convertToRPNExpanded</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a>[]&nbsp;convertToRPNExpanded()</pre>
<div class="block">Convert ParseTree to RPN Stmt array.
 <p>
 Notes on algorithm:
 <ol>
 <li>We don't know the number of nodes in the tree in advance, so to
 generate a Java array of the proper size, we can either count, allocate
 and load, or load into a resizeable list structure then allocate and copy
 when the size is known. Pre-counting means traversing all of the nodes
 twice and then loading the array in reverse order (the top node must be
 at the end of the list). BUT there is overhead associated with resizeable
 lists and with the copy operation. Overall, the difference between the
 two methods is probably not much. So let's try pre-counting since the
 count logic can be separated and reused.
 <li>we also don't know whether the ParseTree is a Syntax Parse Tree or a
 Proof Parse Tree, or even whether or not the ParseTree is "valid". That
 is not the concern of this routine, however.
 </ol></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>RPN Stmt array.</dd></dl>
</li>
</ul>
<a name="squishTree()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>squishTree</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;squishTree()</pre>
<div class="block">Compresses ("squishes") the tree to re-use repeated subtrees.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>this object</dd></dl>
</li>
</ul>
<a name="convertToRPN()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>convertToRPN</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a>[]&nbsp;convertToRPN()</pre>
</li>
</ul>
<a name="convertToRPN(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>convertToRPN</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang">ParseTree.RPNStep</a>[]&nbsp;convertToRPN(boolean&nbsp;pressLeaf)</pre>
</li>
</ul>
<a name="countParseNodes(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>countParseNodes</h4>
<pre>public&nbsp;int&nbsp;countParseNodes(boolean&nbsp;expanded)</pre>
<div class="block">Count parse nodes in a ParseTree.
 <p>
 If root is null, count = zero.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>expanded</code> - true to count repeated subtrees multiple times, false to
            count them as size 1 stubs in subsequent occurrences</dd>
<dt><span class="strong">Returns:</span></dt><dd>number of parse nodes in ParseTree.</dd></dl>
</li>
</ul>
<a name="getMaxDepth()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxDepth</h4>
<pre>public&nbsp;int&nbsp;getMaxDepth()</pre>
<div class="block">Gets the maximum depth of the tree after calculating it if the answer is
 not already known.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>maximum depth of the parse tree</dd></dl>
</li>
</ul>
<a name="resetMaxDepth()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resetMaxDepth</h4>
<pre>public&nbsp;void&nbsp;resetMaxDepth()</pre>
<div class="block">Resets the maximum depth of the tree to the initial value.</div>
</li>
</ul>
<a name="getLevelOneTwo()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLevelOneTwo</h4>
<pre>public&nbsp;java.lang.String&nbsp;getLevelOneTwo()</pre>
<div class="block">Computes the levelOneTwo string (key) value after calculating it if the
 answer is not already known.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>levelOneTwo key string.</dd></dl>
</li>
</ul>
<a name="resetLevelOneTwo()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resetLevelOneTwo</h4>
<pre>public&nbsp;void&nbsp;resetLevelOneTwo()</pre>
<div class="block">Resets the levelOneTwo string key value to the default value;</div>
</li>
</ul>
<a name="toString()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;java.lang.String&nbsp;toString()</pre>
<div class="block">Converts a ParseTree to a String consisting of Stmt labels in RPN order.
 <p>
 Note: this can fail if the ParseTree is invalid. Intended for
 testing/diagnostic use.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>String containing ParseTree statement labels in RPN order.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang"><span class="strong">Prev Class</span></a></li>
<li><a href="../../mmj/lang/ParseTree.RPNStep.html" title="class in mmj.lang"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?mmj/lang/ParseTree.html" target="_top">Frames</a></li>
<li><a href="ParseTree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
